TalentSync

AI resume builder and ATS optimizer for job seekers. Tailored resumes, outreach, and interview prep from one profile.

NLP processing pipeline

The NLP processing pipeline used in TalentSync-Normies for extracting and analyzing resume text from PDF and text files.

Repository layout#

The NLP pipeline spans both backend services and frontend utilities:

  • Backend services handle document ingestion, parsing, formatting, and ML-driven analysis.
  • Frontend utilities convert structured resume data into clean text suitable for ATS evaluation.
  • Analysis notebooks demonstrate preprocessing and ML training workflows.

Building blocks#

  • Document extraction and validation: Parses PDFs and text files, validates resume content, and falls back to LLM-based conversion when needed.
  • Text cleaning and preprocessing: Removes URLs, mentions, punctuation, lemmatizes tokens, and filters stopwords.
  • Named entity recognition and linguistic features: Uses spaCy for lemmatization and POS-based filtering.
  • Skill extraction: Regex-based matching against predefined skill lists.
  • ML-based category prediction: TF-IDF vectorization and gradient boosting classification.
  • Structured text generation: Converts structured resume data to plain text for ATS compatibility.

How it fits together#

The pipeline integrates frontend text generation with backend extraction, formatting, and ML analysis.

Document extraction and validation#

  • Supports TXT, MD, PDF, DOC, DOCX.
  • Uses PyMuPDF to render documents to Markdown for consistent parsing.
  • Validates resumes using keyword presence checks.
  • Falls back to Google GenAI when PDF parsing yields empty text and provider is Google/Gemini.

Text cleaning and preprocessing#

  • Removes URLs, mentions, and punctuation.
  • Lemmatizes tokens using spaCy.
  • Filters stopwords for English.
  • Applies regex-based cleanup and tokenization.

Named entity recognition and linguistic features#

  • Uses spaCy for lemmatization and token-level transformations.
  • Integrates with frontend utility to generate plain text from structured data for consistent ATS evaluation.

Skill extraction algorithm#

  • Predefined skill list compiled from domain expertise.
  • Regex-based matching with word boundaries to avoid partial matches.
  • Case-insensitive matching for reliability.

Machine learning model integration#

  • TF-IDF vectorization transforms cleaned text into numerical features.
  • Gradient Boosting Classifier trained on labeled resume dataset predicts categories.
  • Vectorizer and model persisted as pickle artifacts for inference.

Complete preprocessing pipeline (from raw text to ML-ready features)#

  • Document ingestion and fallback conversion.
  • LLM-based formatting for non-text files.
  • Resume validation via keyword checks.
  • Structured JSON extraction for downstream tasks.
  • TF-IDF vectorization and category prediction.

Dependencies#

  • Backend services depend on:
  • PyMuPDF for PDF parsing.
  • spaCy for lemmatization and tokenization.
  • scikit-learn for TF-IDF and classification.
  • LangChain chains for LLM-based formatting and JSON extraction.
  • Frontend depends on structured resume data to produce plain text for ATS.

Performance#

  • Prefer native text formats (TXT/MD) to bypass expensive PDF parsing.
  • Cache TF-IDF vectorizer and model artifacts to avoid reloading overhead.
  • Limit LLM calls by validating early and formatting only when necessary.
  • Use streaming or chunked processing for large documents to reduce memory pressure.
  • Normalize text once and reuse cleaned text across tasks to minimize repeated computation.

Troubleshooting#

Common issues:

  • Unsupported file type: Ensure file extension is TXT, MD, PDF, DOC, or DOCX.
  • Malformed PDF: Enable fallback conversion when provider supports Google GenAI; otherwise, advise uploading a text-based resume.
  • Empty or invalid resume text: Validate using keyword checks; reject with HTTP 400 if validation fails.
  • LLM errors: Handle rate limits and authentication failures gracefully by falling back to original text.
  • JSON extraction failures: Validate and sanitize LLM responses; fall back to empty dict on parse errors.